import {AfterViewInit, Component, OnInit} from '@angular/core';
import {company, ProduceShareService} from "app/share/produce-share.service";
import {HttpService} from "../share/http.service";
import {url} from "../share/url";
import {flyIn} from "../animations/flyIn";


@Component({
  moduleId: module.id,
  selector: 'my-system_config',
  templateUrl: 'system_config.component.html',
  animations:[
    flyIn
  ]
})

export class system_configComponent implements OnInit, AfterViewInit {
  public getCareersUrl: string = url.url+'/app2/web/page';
  public getCareersParams: object = {page: 'careers'};
  public showBoolean: boolean = true;//用来控制模态框的显示与否
  public richText: string = '';//表示该富文本的内容
  public onlyOne: string = 'needOne';//控制页面的富文本编辑器的数量
  public careersUnique: string = 'careers';
  public showImageUpload: boolean = true;
  public careersToModel:any;
  public show:boolean = false;

  constructor(private http: HttpService) {
  }

  ngOnInit() {
    this.http.httpGet(this.getCareersUrl, this.getCareersParams)
      .subscribe((res) => {
        console.log(res);
        let value = res.results.pagehtmls[0];
        this.careersToModel = value;
        this.show = true;
        this.richText = JSON.stringify(value.htmls[0]);
      });
  }

  ngAfterViewInit() {

  }
  comeFromModalBoolean(){
    this.ngOnInit();
  }

  modifyCompany() {
    this.showBoolean = true;

  }

}
